<div class="page-header">
    <h3><?php echo lang('events_tab_list'); ?></h3>
</div>

<?php if(empty($events)): ?>

<p><?php echo lang('events_none'); ?></p>

<?php else: ?>

<table id="events" class="table table-condensed well">
    <tr>
        <th><?php echo lang('event_publish_date'); ?></th>
        <th><?php echo lang('event_last_update'); ?></th>
        <th><?php echo lang('event_title'); ?></th>
        <th><?php echo lang('event_author'); ?></th>
    </tr>
    <?php foreach($events as $event): ?>
    <tr>
        <td><?php echo $event['publish_date'].' '.$event['publish_time']; ?></td>
        <td><?php echo $event['updated'] ? $event['last_update_date'].' '.$event['last_update_time'] : ''; ?></td>
        <td><?php echo anchor('events/view/'.$event['id'], $event['title']); ?></td>
        <td><?php echo anchor('user_profiles/view/'.$event['author_id'], (($event['author_id'] === $user_id) ? lang('me') : $event['author'])); ?></td>
    </tr>
    <?php endforeach; ?>
</table>

<?php endif; ?>